import request from '@/utils/request.js'
export const userLogin = ({ username, password }) => {
  return request.post('/api/login', { username, password })
}
export const userRegister = ({username, password, repassword}) => {
  return request.post('/api/reg',{
    username: username,
    password: password,
    repassword: repassword
  })
}
export const getUserInfo = () => {
  return request.get('/my/userinfo')
}
// 编辑用户信息

export const editUserInfo = (data) => {
  return request.put('/my/userinfo', data)
}
// 更换用户头像
export const editUserAvatar = (avatar) => {
  return request.patch('/my/update/avatar', {avatar})
}

// 修改用户密码
export const editUserPassword = (data) => {
  return request.patch('/my/updatepwd',data)
}
